import {postReq,successStatus } from "@/common/request"
import {uploadFile} from "@/common/utils"

export const getSuccessStatus=()=>successStatus

/**菜单分页查询的请求  */
export const getMenuPageApi=(body:PageReqParams<MenuType>):Promise<PageResponseData<MenuType>>=>postReq("/admin/menu/page",body)

/**菜单列表查询的请求  */
export const getMenuListApi=(body:Partial<MenuType>={})=>postReq("/admin/menu/list",body)

/**菜单新增的请求  */
export const addMenuApi=(body:AddOrUpdateReqParams<MenuType>[])=>postReq("/admin/menu/add",body)

/**菜单更新的请求  */
export const updateMenuApi=(body:AddOrUpdateReqParams<MenuType>[])=>postReq("/admin/menu/update",body)

/**菜单删除的请求  */
export const deleteMenuApi=(body:IdType[])=>postReq("/admin/menu/deleteByIds",body)

/**菜单导入的请求  */
export const importMenusApi=(file:File)=>uploadFile(file,"file","/admin/menu/import")







